﻿using Microsoft.Extensions.Configuration;

namespace MiniFox.Scripting.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    public class FunctionSetting : IFunctionSetting
    {
        internal const string ELEMENT_NAME = "function";
        const string NAME = "name";
        const string RETURN_FORMAT = "returnFormat";
        const string TYPE = "type";
        const string DESCRIPTION = "description";
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(NAME)]
        public string Name
        {
            get;
            set;
        }
        /// <summary>
        /// 实现FunctionBase的类型
        /// </summary>
        [ConfigurationKeyName(TYPE)]
        public string Type
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(RETURN_FORMAT)]
        public string ReturnFormat
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(DESCRIPTION)]
        public string Description
        {
            get;
            set;
        }
        /// <summary>
        /// 参数配置集合
        /// </summary>
        [ConfigurationKeyName("arguments")]
        public ArgumentSettingCollection ArgumentSettings
        {
            get;
            set;
        } = new();
        /// <summary>
        /// 
        /// </summary>
        IArgumentSettingCollection IFunctionSetting.ArgumentSettings
        {
            get { return this.ArgumentSettings; }
        }
    }
}
